'''

number1 = 0b1000 # 二进制
number2 = 0o2000 # 八进制
number3 = 0xA0F # 十六进制
print(number1)
print(number2)
print(number3)

print("------------------------")

result1 =bin(8)
print(result1)

result2 = oct(1024)
print(result2)

result3 =hex(2575)
print(result3)

print("------------------------------")

num1 = 12.4
print(num1)

num2 = 12.345
print(num2)


**对于浮点数取整的一些说明：**
+ round()   ：  四舍六入五取偶
+ int()    :   取整数部分
+ math.floor()向下取整、math.ceil()向上取整

print(round(num1))
print(int(num2))

print(math.ceil(11.3))
print(math.ceil(11.5))
print(math.ceil(11.6))

print(math.floor(16.3))
print(math.floor(16.5))
print(math.floor(16.8))

print("==================================")

f1 = True
f2 = False
print(f1)
print(f2)

# True可以转换为整数1，False可以转换为整数0
print(False+1) # 1
print(True+1) # 2
print(True+False) # 1
'''
import math

number1 = 0b1000
number2 = 0o2000
number3 = 0xA0F

print(number1)
print(number2)
print(number3)

result1 = bin(8)
print(result1)

result2 = oct(1024)
print(result2)

result3 = hex(2527)
print(result3)

num1 = 12.4
num2 = 12.345
print(num1)
print(num2)

print(round(num1))
print(int(num2))

print(math.floor(11.5))
print(math.floor(11.6))
print(math.floor(11.7))

print(math.ceil(13.5))
print(math.ceil(13.6))
print(math.ceil(13.7))

f1 = True
f2 = False
print(f1)
print(f2)

print(True+1)
print(False+1)



